/***********
 * OVERLAY *
 ***********/

/**
 * Déclarations des fonctions
 */

var freezePage = function(){
	$('.versFicheClient').unbind('click').css('cursor','default');
	$('.menu').fadeTo(400,.5);
	$('#entete').fadeTo(400,.5);
	$('#publicite').fadeTo(400,.5);
	$('#principal').fadeTo(400,.5);
}

var unfreezePage = function(){
	$('.versFicheClient').bind('click', clicClient).css('cursor','pointer');
	$('.menu').fadeTo(400,1);
	$('#entete').fadeTo(400,1);
	$('#publicite').fadeTo(400,1);
	$('#principal').fadeTo(400,1);
}

var clicClient = function() {
	var idC = $(this).attr('id');
	$.get('donneesClient.php?idC='+idC, function(data) {
		  $('#result').html(data);
		  $('img[alt="fermer"]').bind('click',function(){
			  $('#result').toggle();
			  unfreezePage();
		  });
	});
	$('#result').toggle();
	freezePage();
}

/**
 * Exécution
 */

$(document).ready(function() {
	$('.versFicheClient').bind('click', clicClient);
});
